package com.allenja.eleviewer;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        new AlertDialog.Builder(this).setTitle("Please choose the desired mode").setMessage("Explorer mode (Pan and Zoom) GPS mode (Live Navigation)")
        .setPositiveButton("Explorer mode", new DialogInterface.OnClickListener() {	
			public void onClick(DialogInterface dialog, int which) {
				CameraViewActivity.setLocationMode("Explorer");
				
			}
		}).setNegativeButton("GPS mode", new DialogInterface.OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				CameraViewActivity.setLocationMode("GPS");
				/* bring up the GPS settings */
				Intent intent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
				startActivity(intent);
			}
		}).show();
        
        Button cameraView = (Button) findViewById(R.id.button1);
        cameraView.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View view) {
				Intent cameraViewIntent = new Intent(view.getContext(), CameraViewActivity.class);
				startActivityForResult(cameraViewIntent, 0);
			}
		});
        
        Button settingsView = (Button) findViewById(R.id.button2);
        settingsView.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View view) {
				Intent settingsViewIntent = new Intent(view.getContext(), SettingsViewActivity.class);
				startActivityForResult(settingsViewIntent, 0);
			}
		});
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    @Override
    protected void onResume() {
        super.onResume();
    }
    
    @Override
    protected void onPause() {
        super.onPause();
    }
}
